/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: AliceMana
 * Date: 2022-11-23
 * Time: 0:18
 */
import java.lang.reflect.Modifier;
import java.util.*;
public class Main {
    // 数组中出现次数超过一半的数字
    public static int MoreThanHalfNum_Solution (int[] numbers) {
        // write code here
        /*Arrays.sort(numbers);
        return numbers[numbers.length/2];*/
        Map<Integer, Integer> map = new HashMap<>();
        for (int number : numbers) {
            if (!map.containsKey(number)) {
                map.put(number, 1);
            } else {
                map.put(number, map.get(number) + 1);
            }
        }
        int ret = 0;
        for (int number : numbers) {
            if (map.get(number) > numbers.length/2) {
                ret = number;
            }
        }
        return ret;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] arr = new int[9];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = in.nextInt();
        }
        System.out.println(MoreThanHalfNum_Solution(arr));
    }


    // 字符串中找到连续最长的字符串
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        for (int i = 0; i < s.length(); i++) {
            if (!Character.isDigit(s.charAt(i))) {
                s = s.replace(s.charAt(i), ' ');
            }
        }
        String[] ret = s.split(" ");
        int maxIndex = 0;
        for (int i = 0; i < ret.length; i++) {
            if (ret[maxIndex].length() < ret[i].length()) {
                maxIndex = i;
            }
        }
        System.out.println(ret[maxIndex]);
    }


    // 倒置字符串
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        String[] strings = str.split(" ");
        for (int i = strings.length-1; i >= 0; i--) {
            System.out.print(strings[i]+" ");
        }
    }


    // 排序子序列
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] arr = new int[n+1];
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        arr[n] = 0;
        int count = 0;
        int i = 0;
        while (i < n) {
            if (arr[i] < arr[i+1]) {
                while (i < n && arr[i] < arr[i+1]) {
                    i++;
                }
                count++;
                i++;
            }
            if (i < n && arr[i] == arr[i+1]) {
                i++;
            }
            if (i < n && arr[i] > arr[i+1]) {
                while (i < n && arr[i] > arr[i+1]) {
                    i++;
                }
                count++;
                i++;
            }
        }
        System.out.println(count);
    }
}